<!DOCTYPE html>
<html>
<head>
    <title>Login</title>
</head>
<body>
    <h1>Login</h1>
    {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
            {% for category, message in messages %}
                <div class="{{ category }}">{{ message }}</div>
            {% endfor %}
        {% endif %}
    {% endwith %}
    
    <form action="{{ url_for('login') }}" method="post">
        {{ form.hidden_tag() }}
        
        <label for="username">Username:</label>
        {{ form.username() }}<br>
        
        <label for="password">Password:</label>
        {{ form.password() }}<br>
        
        {{ form.submit() }}
    </form>
    
    <p>Don't have an account? <a href="{{ url_for('register') }}">Register</a></p>
</body>
</html>
